package com.tencnet;

import com.tencent.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserServiceFallbackFactory implements FallbackFactory<UserService> {
    @Override
    public UserService create(Throwable throwable) {
        throwable.printStackTrace();
        return new UserService() {
            @Override
            public User findById(Long id) {
                return new User(-1L, "熔断器", "fallbackFactory的回调页面");
            }
        };
    }
}
